-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix incorrectly transposed matrix for displayp3 colorspaces #1960
Fix incorrectly transposed matrix for displayp3 colorspaces #1960
Conversation
Great catch, thanks @ld-kerley! I'm CC'ing @doug-walker and @carolalynn on this PR, to make sure we're remaining aligned with the upcoming NanoColor project. |
Also just cc'ing @meshula about this too. |
@jstone-lucasfilm , it looks like this PR should get MaterialX much closer to NanoColor. Here is what NanoColor gives for that conversion, based on the draft config that implements the ASWF Color Interop Forum color spaces and evaluating the result at single precision: So it's fairly well aligned with this PR (enough to normally be below visual tolerances) but there are typically some small differences in matrices such as this based on the details of how they are calculated. For OCIO we use the chromaticity coordinates as the definitive parameters and calculate the matrix values to the reference space at double precision. But then since neither lin_displayp3_scene or lin_rec709_scene are the reference space, there would be some slight loss involved when composing the two matrices (although this is done at double precision too). The direct double precision result from chromaticities, without compositional loss, is the following (which would be closest to the "true" value): |
Thanks @doug-walker, and in this context, I'd have no objections to moving forward with the matrix transpose in this pull request. Further in the future, we're planning to import our color transform graphs directly from NanoColor, at which point any differences in precision assumptions should be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks @ld-kerley!
a20bef0
into
AcademySoftwareFoundation:main
Since @dgovil summoned me, the matrix Doug wrote out matches the results of the nanocolor implementation currently underpinning GfColor in OpenUSD. |
Backporting #1960 to legacy 1.38 branch. This feels like a pretty easy bug fix backport that would be to everyones benefit.
When originally authored the matrix was authored transposed. Further internal testing revealed this to manifest as an undesired shift towards red.
Before
After